/*
 Navicat Premium Data Transfer

 Source Server         : mysql5.7
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : localhost:3306
 Source Schema         : mymall

 Target Server Type    : MySQL
 Target Server Version : 50728
 File Encoding         : 65001

 Date: 14/10/2021 14:35:41
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for address
-- ----------------------------
DROP TABLE IF EXISTS `address`;
CREATE TABLE `address` (
  `id` int(11) NOT NULL COMMENT '地址id',
  `userid` int(11) NOT NULL COMMENT '用户id',
  `cname` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '收货人姓名',
  `caddress` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '收货人地址',
  `remark` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '备注'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of address
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for comment
-- ----------------------------
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
  `id` int(11) NOT NULL COMMENT '详情id',
  `goodsid` int(11) NOT NULL COMMENT '商品id',
  `userid` int(11) NOT NULL COMMENT '评论人id',
  `context` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '评论内容',
  `time` datetime DEFAULT NULL COMMENT '评论时间',
  `parentid` int(11) DEFAULT NULL COMMENT '评论树节点',
  PRIMARY KEY (`id`),
  KEY `goodsid` (`goodsid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of comment
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for goods
-- ----------------------------
DROP TABLE IF EXISTS `goods`;
CREATE TABLE `goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '商品id',
  `name` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '商品名',
  `context` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '商品信息',
  `price` decimal(10,2) NOT NULL COMMENT '商品价格',
  `factory` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '商品厂家',
  `sale` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '销量',
  `likes` int(11) DEFAULT NULL COMMENT '点赞数',
  `picture` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '商品图片',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of goods
-- ----------------------------
BEGIN;
INSERT INTO `goods` VALUES (1, 'ccc', 'aaa', 89.90, 'aaa', '8000', 8000, '/img');
INSERT INTO `goods` VALUES (2, 'ccc', 'aaa', 11.20, '123', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for shopcart
-- ----------------------------
DROP TABLE IF EXISTS `shopcart`;
CREATE TABLE `shopcart` (
  `id` int(11) NOT NULL COMMENT '购物车id',
  `goodsid` int(11) NOT NULL COMMENT '商品id',
  `userid` int(11) NOT NULL COMMENT '用户id'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of shopcart
-- ----------------------------
BEGIN;
INSERT INTO `shopcart` VALUES (1, 1, 1001);
INSERT INTO `shopcart` VALUES (2, 2, 1001);
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '用户id',
  `username` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '用户名',
  `password` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '密码',
  `grants` int(11) NOT NULL COMMENT '授权码',
  `realname` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '真实姓名',
  `phone` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '电话号码',
  `picture` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '头像路径',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1008 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES (1001, 'admin', '123456', 1, '孙培豪', '13665094057', '/img/admin/header.png');
INSERT INTO `user` VALUES (1002, 'srpihot', '123456', 1, '孙培豪', '13665094057', NULL);
INSERT INTO `user` VALUES (1003, 'abc', 'abc', 0, 'abc', '112', NULL);
INSERT INTO `user` VALUES (1004, 'bca', 'bca', 0, 'bca', '113', NULL);
INSERT INTO `user` VALUES (1005, 'bbb', 'bbb', 0, 'bbb', '114', NULL);
INSERT INTO `user` VALUES (1006, 'ccc', 'ccc', 0, 'ccc', '1113', NULL);
INSERT INTO `user` VALUES (1007, 'ddd', 'ddd', 0, 'ddd', '112', NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
